Skip to content

Feature/pingpay phase 1#625

Merged
aunali8812 merged 2 commits into
stagingfrom
feature/pingpay-phase-1
Apr 29, 2026
Merged

Feature/pingpay phase 1#625
aunali8812 merged 2 commits into
stagingfrom
feature/pingpay-phase-1

Conversation

@aunali8812

@aunali8812 aunali8812 commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added automatic recipient registration check for USDC transfers with user-facing notification.
  • Bug Fixes

    • Fixed decimal place display for USDC and USDT donations (now 4 places for stablecoins).
    • Improved token icon rendering for donations.
  • Chores

    • Disabled FastDonateButton on campaign banners.
    • Extended payment processing timeout window.

@aunali8812 aunali8812 requested a review from Ebube111 as a code owner April 29, 2026 16:43
@vercel

vercel Bot commented Apr 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
potlock-next-app Ready Ready Preview, Comment Apr 29, 2026 4:45pm

Request Review

@coderabbitai

coderabbitai Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR extends the PingPay callback polling timeout, disables FastDonateButton in campaign banners, adds USDC recipient registration pre-checks to PingPayModal, introduces a PINGPAY_USDC_TOKEN_CONTRACT_ID constant, improves donation item token display with decimal handling workarounds, and updates the donations API pagination parameter from limit to page_size.

Changes

Cohort / File(s) Summary
PingPay Polling & USDC Registration
src/app/pingpay/callback/page.tsx, src/features/pingpay/components/PingPayModal.tsx, src/features/pingpay/constants.ts
Extends polling retry budget from 15 to 60 attempts (~120s window); adds pre-flight FT recipient storage balance check in modal, displays UI note when registration needed, and performs one-time storage_deposit call before PingPay session creation if recipient is unregistered; introduces PINGPAY_USDC_TOKEN_CONTRACT_ID constant.
Campaign UI
src/entities/campaign/components/CampaignBanner.tsx
Disables FastDonateButton donation UI by replacing JSX with commented-out markup and feature-disabled note.
Donation Display & API
src/layout/profile/_deprecated/DonationItem.tsx, src/layout/profile/_deprecated/accounts.ts
Updates DonationItem to prioritize token account field for ftId, applies decimals workaround for USDC/USDT (forcing 6 decimals), adjusts display precision based on decimals, and improves token icon rendering; updates donations API to use page_size instead of limit.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Modal as PingPayModal
    participant FTContract as FT Contract
    participant PingPay as PingPay Session
    
    rect rgba(100, 150, 255, 0.5)
    Note over User,PingPay: USDC Recipient Registration Flow
    end
    
    User->>Modal: Open modal (non-campaign flow)
    activate Modal
    Modal->>FTContract: Query storage_balance_of(recipientAccountId)
    activate FTContract
    FTContract-->>Modal: Return balance (null if unregistered)
    deactivate FTContract
    
    alt Recipient Unregistered
        Modal->>User: Display registration required note
        User->>Modal: Submit donation
        Modal->>FTContract: Call storage_deposit(min_balance)
        activate FTContract
        FTContract-->>Modal: Success or Error
        deactivate FTContract
        
        alt Deposit Succeeds
            Modal->>PingPay: Create session
            activate PingPay
            PingPay-->>Modal: Session created
            deactivate PingPay
        else Deposit Fails
            Modal->>User: Display error
        end
    else Recipient Already Registered
        User->>Modal: Submit donation
        Modal->>PingPay: Create session directly
        activate PingPay
        PingPay-->>Modal: Session created
        deactivate PingPay
    end
    
    deactivate Modal
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feature/pingpay phase 1 #623 — Modifies the same PingPay feature files (callback, modal, constants) with overlapping donation/token handling logic.
  • Finalize FT donation flow #366 — Adds fungible-token storage-deposit pre-checks and FT contract handling, directly related to the USDC registration workflow introduced here.
  • Done with Edit Profile Changes #427 — Modifies CampaignBanner.tsx component rendering logic, overlapping with the FastDonateButton disabling change.

Suggested reviewers

  • Ebube111
  • carina-akaia

Poem

🐰 The rabbit polls for longer now,
USDC checks take their bow,
Tokens dance with decimals bright,
Storage fees settle just right! 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Feature/pingpay phase 1' is vague and generic, using non-descriptive terminology that fails to convey the specific changes made in the changeset. Revise the title to be more specific about the primary change, such as 'Add USDC recipient storage deposit check for PingPay' or 'Implement PingPay Phase 1: storage deposit validation and callback polling improvements'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/pingpay-phase-1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@aunali8812 aunali8812 merged commit f2d8fe9 into staging Apr 29, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant